<template>
  <div>
    <div class="top">
      <h1>八维智慧酒店</h1>
      <input
        type="button"
        value="退出"
        class="btn btn-danger"
        @click="router.push('/loginView')"
      />
    </div>
    <div class="box">
      <nav class="left">
        <ul>
          <li><RouterLink to="/memberRightAdd">会员权益增加</RouterLink></li>
          <li><RouterLink to="/memberLevelAdd">会员等级增加</RouterLink></li>
          <li><RouterLink to="/memberLevelList">会员等级列表</RouterLink></li>
          <li><RouterLink to="/memberAdd">会员增加</RouterLink></li>
          <li><RouterLink to="/memberList">会员列表</RouterLink></li>
          <li style="border-bottom: 1px solid #fff"></li>
          <li><RouterLink to="/shopAdd">门店增加</RouterLink></li>
          <li><RouterLink to="/shopList">门店列表</RouterLink></li>
          <li><RouterLink to="/shopCountList">门店统计</RouterLink></li>
          <li style="border-bottom: 1px solid #fff"></li>
          <li><RouterLink to="/discountAdd">优惠券增加</RouterLink></li>
          <li><RouterLink to="/discountList">优惠券列表</RouterLink></li>
          <li style="border-bottom: 1px solid #fff"></li>
          <li><RouterLink to="/testList">周考二列表</RouterLink></li>
          <li><RouterLink to="/houseTypeAdd">房型增加</RouterLink></li>
          <li><RouterLink to="/houseTypeList">房型列表</RouterLink></li>
          <li><RouterLink to="/houseNoAdd">房号增加</RouterLink></li>
          <li><RouterLink to="/houseNoList">房号列表</RouterLink></li>
          <li><RouterLink to="/houseRowAdd">排房增加</RouterLink></li>
          <li><RouterLink to="/shopListNew">门店列表新</RouterLink></li>
          <li><RouterLink to="/housePriceAdd">房价计划增加</RouterLink></li>
        </ul>
      </nav>
      <div class="right">
        <RouterView></RouterView>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
import { useStore } from '@/stores/user';
import { onMounted } from 'vue';

const router = useRouter();
const a = useStore();

onMounted(() => {
  if (a.userInfo.Id) {
  } else {
    router.push('/loginView');
  }
});
</script>

<style scoped>
.top {
  height: 100px;
  display: flex;
  justify-content: space-between;
  background-color: rgb(112, 162, 231);
  align-items: center;
  padding: 0 10px;
}
li {
  list-style: none;
  line-height: 26px;
  text-align: center;
}
.box {
  display: flex;
}

.left {
  width: 200px;
  height: calc(100vh - 100px);
  background-color: rgb(245, 144, 206);
}
.right {
  flex: 1;
  padding: 0 10px;
}
</style>
